/**
 *
 */
package andersonb.routebuilders;

import org.apache.camel.Exchange;

import andersonb.beans.Transporte;

import com.thoughtworks.xstream.XStream;

/**
 * @author Anderson Bernardo
 *
 */
public class TraduzTransporte {

	public void traduz(final Exchange e) {
		String xml = e.getIn().getBody(String.class);

		XStream xstream = new XStream();
		xstream.alias("transporte", Transporte.class);
		Transporte transporte = (Transporte) xstream.fromXML(xml);

		e.getIn().setBody(transporte);
	}
}
